import request from "../request";
// 上传文件 是否展示提醒
export const getRemindInfo = (params = {}) => {
    return request({
        url: "/system/config/getUploadInfo",
        method: "get",
        params: params,
        methodType: "jsonStr",
    });
};


// 调阅管理 - 申请列表
export const getApplyReadList = (data) => {
    return request({
        url: "/qcdoc-archive/archive/add",
        method: "post",
        params: data,
        methodType: "jsonStr",
    });
};

// 用户窍列表
export const getUserBoxList = (data, params) => {
    return request({
        url: "/business/userBox/list",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};

// 用户窍列表 -- 联动标签查询 , 查询后 一起 下架
export const getUserBoxListByTag = (data, params) => {
    return request({
        url: "/business/userBox/listByTag",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};

//  用户窍列表 -- 获得总数
export const getUserBoxListCount = (data, params) => {
    return request({
        url: "/business/userBox/listCount",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};

// 根据 窍id 查询标签
export const getTaglistByUserBoxId = (params) => {
    return request({
        url: "/business/userTag/listByUserBoxId",
        method: "get",
        params: params,
        methodType: "jsonStr",
    });
};

// 批量查询窍标签
export const getTaglistByUserBoxIds = (data) => {
    return request({
        url: "/business/userTag/listByUserBoxIds",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 窍详情
export const getUserBoxDetail = (boxId) => {
    return request({
        url: `/business/userBox/detail?id=${boxId}`,
        method: "get",
        methodType: "jsonStr",
    });
};
// 查询窍下 档案窍
export const getUserBoxSubList = (data, params) => {
    return request({
        url: "/business/userBoxSub/list",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};
// 窍 电子化列表
export const getBoxFileList = (data) => {
    return request({
        url: '/business/userBoxFile/list',
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 电子化详情 - 获得下载地址
export const getBoxFileDetail = (id) => {
    return request({
        url: `/business/userBoxFile/detail?id=${id}`,
        method: "get",
        methodType: "jsonStr",
    });
};

// 窍  图片列表
export const getBoxPicList = (userBoxId) => {
    return request({
        url: `/business/userBoxPic/list?userBoxId=${userBoxId}`,
        method: "get",
        methodType: "jsonStr",
    });
};

// 添加标签
export const addUserTag = (data, params) => {
    return request({
        url: "/business/userTag/add",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};
// 删除标签
export const deleteUserTag = (params) => {
    return request({
        url: "/business/userTag/delete",
        method: "post",
        params: params,
        methodType: "jsonStr",
    });
};

// 档案中心统计
export const getUserBoxStatistics = (params) => {
    return request({
        url: "/business/userBox/statistics",
        method: "get",
        params: params,
        methodType: "jsonStr",
    });
};

// 档案中心统计 当天出入库数据 ---- 未使用到
export const getCountBoxByToday = (data) => {
    return request({
        url: "/depot/actionLog/countBoxByToday",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 申请调阅  、 回库 、 销毁 、 永久下架
export const toApplyBorrow = (data, params) => {
    return request({
        url: "/business/order/applyBorrow",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};
// 上传 订单附件
export const toUploadFile = (data, params) => {
    return request({
        url: "/business/order/uploadFile",
        method: "post",
        data: data,
        params: params,
        methodType: "formData"
    });
};

// 加入调阅列表
export const toAddTemp = (data, params) => {
    return request({
        url: "/business/userBox/addTemp",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};

// 批量导入临时窍
export const toImportTemp = (data, params) => {
    return request({
        url: "/business/userBox/importTemp",
        method: "post",
        data: data,
        params: params,
        methodType: "formData",
    });
};

// 临时窍列表
export const getTempBoxList = (type, params) => {
    return request({
        url: `/business/userBox/tempList?type=${type}`,
        method: "get",
        params: params,
        methodType: "jsonStr",
    });
};
// 临时窍列表 数量
export const getTempBoxListNum = (type) => {
    return request({
        url: `/business/userBox/tempCount?type=${type}`,
        method: "get",
        methodType: "jsonStr",
    });
};

// 移除/清空临时窍
export const toRemoveTemp = (params, data) => {
    return request({
        url: "/business/userBox/removeTemp",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};

// 调阅记录   调阅审批  -  status 0-待处理 1-处理中 2-已完成 3-已取消
export const getOrderList = (data, params) => {
    return request({
        // url: "/business/order/list",
        url: "/business/order/listNoCount",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};

// 查询调阅记录总数
export const getOrderListCount = (data, params) => {
    return request({
        url: "/business/order/listCount",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};

// 订单详情 - 得到 订单中 窍的信息
export const getOrderDetail = (id) => {
    return request({
        url: `/business/order/detail?id=${id}`,
        method: "get",
        methodType: "jsonStr",
    });
};

// 订单 窍列表
export const getOrderBoxList = (data, params = {}) => {
    return request({
        url: '/business/order/boxList',
        method: "post",
        data: data,
        // { orderId: id, searchBoxCode: boxCode },
        params: params,
        methodType: "jsonStr",
    });
};

// 批准 全部窍调阅
export const approveAllReadOrder = (params) => {
    return request({
        url: "/business/order/approveAll",
        method: "post",
        params: params,
        methodType: "jsonStr",
    });
};

// 批准 单个申请
export const approveReadOrder = (params) => {
    return request({
        url: "/business/order/approve",
        method: "post",
        params: params,
        methodType: "jsonStr",
    });
};

// 订单取消
export const cancelReadOrder = (data, params) => {
    return request({
        url: "/business/order/applyCancel",
        method: "post",
        data: data,
        params: params,
        methodType: "jsonStr",
    });
};


// 窍操作记录   
export const getBoxLog = (params) => {
    return request({
        url: '/depot/actionLog/listByUserBoxId',
        params: params,
        method: "get",
        methodType: "jsonStr",
    });
};

// 操作记录 - 看出入库列表
export const getInOrOutLogList = (data, params) => {
    return request({
        url: '/depot/actionLog/inOrOutList',
        data: data,
        params: params,
        method: "post",
        methodType: "jsonStr",
    });
};


//订单 申请人列表
export const getApplyUserList = () => {
    return request({
        url: '/business/order/getUserList',
        method: "get",
        methodType: "jsonStr",
    });
};

// 订单 - 操作日志
export const getOrderLog = (orderId) => {
    return request({
        url: `/depot/actionLog/listByOrderId?orderId=${orderId}`,
        // url: `/business/order/logs?instanceId=${instanceId}`,
        method: "get",
        methodType: "jsonStr",
    });
};


// 仓库列表
export const getDepotList = (data) => {
    return request({
        url: '/system/depot/list',
        data: data,
        method: "post",
        methodType: "jsonStr",
    });
};

// 窍详情 - 导出调阅记录
export const exportBorrowPDF = (userBoxId) => {
    return request({
        url: `/depot/actionLog/exportBorrowPDF?userBoxId=${userBoxId}`,
        method: "get",
        methodType: "jsonStr",
    });
};

//订单 - 附件凭证列表
export const getOrderFileList = (id, type) => {
    // type 0-申请 1-  2-完成  3-取消
    return request({
        url: `/business/order/fileList?id=${id}&type=${type}`,
        method: "get",
        methodType: "jsonStr",
    });
};

// 查询用户
export const getUserList = (data) => {
    return request({
        url: '/system/user/list',
        data: data,
        method: "post",
        methodType: "jsonStr",
    });
};


// 档案提走 - 独立审核页面 - 移动端 
export const getTakeOrder = (params) => {
    return request({
        url: '/business/order/takeBoxList',
        // /business/order/takeBoxList
        params: params,
        method: "get",
        methodType: "jsonStr",
    });
};

// 审批 档案提走订单 单个窍或 全部
export const examineApplyOrderBox = (data) => {
    return request({
        url: '/business/order/applyOrderBox',
        data: data,
        method: "post",
        methodType: "jsonStr",
    });
};

// 空窍申请 - 确认签收
export const orderExecute = (data, params) => {
    return request({
        url: '/business/order/execute',
        data: data,
        params: params,
        method: "post",
        methodType: "jsonStr",
    });
};

// 查看行为蚂蚁链信息
export const lookAntChainInfo = (params) => {
    return request({
        url: "/system/chain/queryByBusinessId",
        method: "post",
        params: params,
        methodType: "jsonStr",
    });
};

// 电子调阅 - 获得联系人列表 - 参数填入 - 客服使用
export const contractPeopleList = (data) => {
    return request({
        url: "/business/order/contractList",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};